#ifndef NULL_OBJECT_PATTERN_H
#define NULL_OBJECT_PATTERN_H

#include <string>
#include <vector>

using namespace std;

class AbstractCustomer
{
public:
    virtual ~AbstractCustomer() {}

    virtual bool isNil() = 0;
    virtual string getName() = 0;

protected:
    string name;
};

class RealCustomer : public AbstractCustomer
{
public:
    RealCustomer(string name);
    ~RealCustomer() {}

    bool isNil() override;
    string getName() override;
};

class NullCustomer : public AbstractCustomer
{
public:
    ~NullCustomer() {}

    bool isNil() override;
    string getName() override;
};

class CustomerFactory
{
public:
    ~CustomerFactory() {}

    static AbstractCustomer* getCustomer(string name);

public:
    static string names[3];
};

#endif // NULL_OBJECT_PATTERN_H

/*
    string CustomerFactory::names[3] = {"Rob", "Joe", "Julie"};


    AbstractCustomer* customer1 = CustomerFactory::getCustomer("Rob");
    AbstractCustomer* customer2 = CustomerFactory::getCustomer("Bob");
    AbstractCustomer* customer3 = CustomerFactory::getCustomer("Julie");
    AbstractCustomer* customer4 = CustomerFactory::getCustomer("Laura");

    cout << "Customers" << endl;
    cout << customer1->getName() << endl;
    cout << customer2->getName() << endl;
    cout << customer3->getName() << endl;
    cout << customer4->getName() << endl;
    */
